package test.my.com.myapplicationtest.DesignPatterns.SingletonPattern;

/**
 * Author : Cooper
 * Time : 2017/8/18  17:47
 * Description :懒汉式
 */

public class SingletonTwo {
    private static SingletonTwo instance;

    private SingletonTwo() {
    }

    public static synchronized SingletonTwo getInstance() {
        if (instance == null) {
            instance = new SingletonTwo();
        }
        return instance;
    }
}
